import React from 'react';
import MenuCon from './MenuCon';
class Affix extends React.Component{

    render(){
        const {menus ,active} = this.props;
        if(menus && menus.length){
            return(
                <React.Fragment>
                    <MenuCon style={{position:'absolute',width:'198px',top:'0',right:0,bottom:0}} fixed={{position:'fixed',top:'0',marginLeft:'820px',right:'auto',bottom:'40px'}}>
                        <ul className="m-oppose-ct">
                            {menus.map((item,key)=>{
                                return (
                                    <li key={key} className={`m-oppose-mn ${active==key?'s-crt':'' }`} title={item.name} onClick={()=>{this.props.changeActive(key,item.name)}}>
                                        <a href="javascript:;" >{item.name}</a>
                                    </li>
                                )
                            })}
                        </ul>
                    </MenuCon>
                </React.Fragment>
             )
        }
        else{
            return null;
        }
    }
}
export default Affix;